import * as Constant from '../constants/Constant'

import fetch from 'isomorphic-fetch'

export function showTweetAll(tweets){
	return{
		type:Constant.TWEET_SHOW_ALL,
		tweets:tweets
	}
}

export function fetchTweetList(){
	return dispatch =>{
		return fetch(ENV.baseUrl+'/tweet_list',{credentials: 'include'})
			.then(response=>response.json())
			.then(json=>dispatch(showTweetAll(json)))
	}
}
